Display values from a database (bind report elements to data)

Report controls can either display static information or dynamic data (fetched from the database).

Data-bound controls are indicated by a yellow database icon in their top-right corner, both in the Design Panel and Report Explorer.

Example of data-bound controls

Embedding information in a report can easily be done using one of the following approaches:

After a control is bound to data, you may wish to employ additional features, which are listed in the final section of this topic.

Using the Field List

To bind an existing report control to a data field, click on the required field item in the Field List, and then drag and drop it onto the control. The yellow database icon inside it will indicate that it's been successfully bound.

Adding a field item

To add a new data-bound control, simply drag the required data field from the Field List onto a report band. This will create a label bound to this data field.

A more flexible way to create data-bound elements is to right-click on a Field List item, and then drag and drop it onto a report. This will open the context menu, where you can choose which control should represent your data, and it will be automatically created and bound to the selected data field.

Creating data-bound elements via context menu

Using the Smart Tag

Click on a control's Smart Tag, and in the actions list, expand the Data Binding drop-down list, and select the required data field.

Selecting a data field via Smart Tag

Using the Property Grid

Click on a control to select it, and in the Property Grid, expand the (Data Bindings) branch that holds the bindable options. Specify a data field for the required attribute (e.g. Text).

Binding options in the Property Grid

Special capabilities

After a control is bound, you can apply formatting to its dynamic content (e.g. for it to be treated as currency, or date-time content). For details on this, see Change value formatting of report elements.

It is possible to make a control display a result of a summary function calculated across the data field to which it is bound. For details on this, see Add totals to a report.

Another noteworthy option is to combine both static and dynamic content within the same control (e.g. to append some text prefix or postfix to a value obtained from a database), or even bind a control to multiple data fields at one time. This is detailed in Use mail merge in report elements.

If it's required to perform some pre-calculations over the data field to which a control is bound, this can be done by creating a calculated field, and binding the control to it. This is detailed in Add calculated fields.

In turn, a calculated field may contain both dynamic and static parameters, which can be requested each time a report is being previewed. For more information, see Add parameters.